import React from 'react';
import { Form, Input } from 'antd';
import { basicFormItemLangLayout } from '@/utils/commons';
import { ASelect, QueryFilterForm } from '@/components/SelfComp';
import { DataItem, QueryFormProps } from '@/types/global';

export type JobQueryProps = QueryFormProps & {
  jobStatusData: DataItem[]
}

const FormItem = Form.Item;

const JobQueryForm: React.FC<JobQueryProps>  = (props) => {

  const { colon, loading, onSubmit, onReset, jobStatusData } = props;
  const formItemLayout = basicFormItemLangLayout;

  return (
    <QueryFilterForm
      colon={colon}
      loading={loading}
      onSubmit={onSubmit}
      onReset={onReset}
    >
      <FormItem label='任务名称' name='jobName' {...formItemLayout} colon={colon}>
        <Input placeholder='支持模糊查询'/>
      </FormItem>
      <FormItem label='任务执行bean' name='invokeTarget' {...formItemLayout} colon={colon}>
        <Input />
      </FormItem>
      <FormItem label='任务状态' name='jobStatus' {...formItemLayout} colon={colon}>
        <ASelect dataSource={jobStatusData} />
      </FormItem>
    </QueryFilterForm>
  );
}

export default JobQueryForm